package com.insurance.controller;

import com.insurance.constants.SystemConstants;
import com.insurance.domain.ResponseResult;
import com.insurance.domain.entity.Comment;
import com.insurance.service.CommentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/comment")
public class CommentController {

    @Resource
    private CommentService commentService;

    //获取评论列表
    @GetMapping("/commentList")
    public ResponseResult commentList(Long productId, Integer pageNo,Integer pageSize){
        return commentService.commentList(productId,pageNo,pageSize);
    }
    //添加评论
    @PostMapping("/add")
    public ResponseResult addComment(@RequestBody Comment comment){
        return commentService.addComment(comment);
    }
}
